<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>更新客户专有商品</title>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Validform/5.3.2/style.css" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" href="../../../ht-css/serviceProvider/examination.css">
    <link href="../../../lib/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
    <link href="../../../ht-css/serviceProvider/customerProperProduct/customerUpdate.css" rel="stylesheet" />

    <style>
        #first,#second,#third,#fourth {
            float: left;
            width: 158px;
            overflow-y:scroll;
            height: 150px;
            border:1px solid #DDDDDD;
            background-color: #FFFFFF;
            padding: 5px;
        }
        #second {
            margin-left: 5px;
            margin-right:5px
        }
        #third {
            margin-right: 5px;
        }
        .search-classify,.search-brand {
            position: absolute;
            z-index: 999;
        }
        .classify-warp,.brand-warp {
            width: 533px;
            border:1px solid #DDDDDD;
            height: 100px;
            background-color: #FFFFFF;
            z-index: 99;
            overflow:auto;
        }
        .brand-item {
            line-height: 25px;
            text-align: center;
        }
        .classify-item{
            line-height: 25px;
            text-align: left;
        }
        .classify-item:hover {
            background-color: #DDDDDD;
            cursor: pointer;
        }
        .brand-item:hover{
            background-color: #DDDDDD;
            cursor: pointer;
        }
        .selectedClassify{
            color:#4a90e2;
        }
        .item-image {
            display: inline-block;
        }
        .itemimage {
            width: 100px;
            height: 100px;
        }
        /*单位*/
        .search-unit{
            display: none;
            position: absolute;
            width: 180px;
            height: 100px;
            overflow: auto;
            border:1px solid #DDDDDD;
            background-color: #FFFFFF;
            margin-left: 10px;
            border-radius: 4px;
            z-index: 999;
            top:45px;
        }
        .unit-item{
            line-height: 20px;
            cursor: pointer;
        }
        .unit-item:hover{
            background-color: #DDDDDD;
        }
        .deleteImg {
            width: 25px;
            height: 25px;
            vertical-align: middle;
            position: absolute;
            margin-left:24px;
        }
        .detail-content{
            padding-top:10px;
            padding-left: 20px;
            overflow: hidden;
        }

        .select2-container{
            width: 180px !important;
        }
    </style>
</head>
<body>
<form id="customerForm" method="post">
    <!--模块一-->
    <div class="section1">
        <div class="detail-content" id="modifyClassify" style="display: none">
            <label class="form-label f-l pt-5">
                <i style="color: red;margin-right: 5px">*</i>服务商：</label>
            <span class="f-l pt-5"  id="modifyClassifyName"></span>
        </div>
        <div class="detail-content" id="addClassify" style="display: none">
            <label class="form-label f-l pt-5"><i style="color: red;margin-right: 5px">*</i>服务商：</label>
            <span class="select-box size-M radius col-xs-1 ml-10"  id="addClassifyName" style="width:15%;border: solid 0px #ddd;">
                    <select class="select" name="serviceProvider"  id="serviceProvider">
                    </select>
            </span>
            <span class="Validform_checktip"></span>
        </div>
        <div class="detail-content" style="display: none" id="modifyCustomer">
            <label class="form-label f-l pt-5"><i style="color: red;margin-right: 5px">*</i>商品专属渠道：</label>
            <span class="f-l pt-5" id="modifyChannelName"></span>
        </div>
        <div class="detail-content"  id="addCustomer">
            <label class="form-label f-l pt-5"><i style="color: red;margin-right: 5px">*</i>商品专属渠道：</label>
            <span class="select-box size-M radius col-xs-1 ml-10" style="width:15%;"  id="addCustomerName">
                    <select
                            class="select"
                            id="productCustomer"
                            placeholder="请选择专属渠道"
                            nullmsg="请选择专属渠道"
                            datatype="*"
                    >
                        <option value="-1" selected>请选择专属渠道</option>
                    </select>
                </span>
            <span class="Validform_checktip"></span>
        </div>
    </div>
    <!--模块二-->
    <div class="section1">
        <div class="title">基本信息</div>
        <div class="detail-content">
            <label class="form-label f-l pt-5"><i style="color: red;margin-right: 5px">*</i>商品名称：</label>
            <div class="formControls col-sm-4">
                <input type="text" class="input-text radius" id="productName" datatype="/^[\s\S]{1,40}$/" placeholder="请输入商品名称" number="40" maxlength="40" nullmsg="请输入商品名称" errormsg="最多支持输入40个汉字长度" autocomplete="off" >
            </div>
            <span class="Validform_checktip"></span>
        </div>
        <div class="detail-content">
            <label class="form-label f-l pt-5 label-4"><i style="color: red;margin-right: 5px">*</i>商品品类：</label>
            <div class="formControls col-sm-6" >
                <input
                        style="width: 66%"
                        type="text"
                        class="input-text radius"
                        id="inputProductClassify"
                        datatype="*"
                        errormsg="请输入商品品类"
                        nullmsg="请输入商品品类"
                        placeholder="商品品类模糊查询"
                        autocomplete="off"
                >
                <div class="search-classify" style="display: none" id="productClassify">
                    <ul class="classify-warp">
                    </ul>
                </div>
                <div style="margin-top: 10px;text-align: left">
                    <ul id="first"></ul>
                    <ul id="second"></ul>
                    <ul id="third"></ul>
                    <ul id="fourth"></ul>
                </div>
            </div>
            <span class="Validform_checktip"></span>
        </div>
        <div class="detail-content">
            <label class="form-label f-l pt-5"><i style="color: red;margin-right: 5px">*</i>归类名称：</label>
            <span class="select-box size-M radius col-xs-1 ml-10" style="width: 32%">
                    <select
                            class="select"
                            id="classifyName"
                            placeholder="请选择归类名称"
                            nullmsg="请选择归类名称"
                            datatype="*"
                    >
                          <option value="" selected>请选择归类名称</option>
                    </select>
                </span>
            <span class="Validform_checktip"></span>
        </div>
        <div class="detail-content">
            <label class="form-label f-l pt-5 ml-5">税类编码：</label>
            <span class="f-l pt-5 ml-20"  id="revenueCode"></span>
        </div>
        <!--品牌-->
        <div class="detail-content add-brandName" style="overflow: inherit">
            <label class="form-label f-l pt-5 ml-20"><i style="color: red;margin-right: 5px">*</i>品牌：</label>
            <div class="formControls col-sm-4" id="selectBrand" >
                <input
                        type="text"
                        class="input-text radius"
                        id="brandName"
                        datatype="*"
                        errormsg="请输入商品品牌"
                        nullmsg="请输入商品品牌"
                        placeholder="请输入品牌"
                        autocomplete="off"
                        ignore="ignore"
                >
                <div class="search-brand" style="display: none">
                    <ul class="brand-warp">
                        <li class="brand-item"></li>
                    </ul>
                </div>
                <!--<div style="cursor: pointer; display: inline-block; width: 200px;position:absolute;margin-left: 10px">没找到想要的品牌？<span style="color:#4A90E2" class="addBrandName">点此处添加</span></div>-->
                <div style="cursor: pointer;  width: 200px;position:absolute;left:100%;top:2px">没找到想要的品牌？<span style="color:#4A90E2" class="addBrandName">点此处添加</span></div>
            </div>
            <span class="Validform_checktip" style="margin-left: 180px"></span>

        </div>
        <!--自定义品牌-->
        <div class="detail-content add-definedName" style="display: none;">
            <label class="form-label f-l pt-5 ml-20"><i style="color: red;margin-right: 5px">*</i>品牌：</label>
            <div class="formControls col-sm-4" id="definitionBrand">
                <input
                        type="text"
                        class="input-text radius"
                        placeholder="请输入自定义品牌"
                        id="definitionBrandName"
                        datatype="*"
                        errormsg="请输入自定义品牌"
                        nullmsg="请输入自定义品牌"
                        ignore="ignore"
                >
                <span style="cursor: pointer; display: inline-block; width: 200px;position:absolute;color:#4A90E2;margin-left: 10px" class="selectBrandName">选择已有商品</span>
            </div>
            <span class=" Validform_checktip" style="margin-left: 80px"></span>
        </div>
        <!--<div class="detail-content" style="clear: both">
            <label class="form-label f-l pt-5 ml-30">产地：</label>
            <div class="formControls col-sm-4">
                <input type="text" class="input-text radius" id="origin" placeholder="请输入产地">
            </div>
        </div>
        <div class="detail-content">
            <label class="form-label f-l pt-5 ml-20"><i style="color: red;margin-right: 5px">*</i>材质：</label>
            <div class="formControls col-sm-4">
                <input type="text" class="input-text radius" id="material" placeholder="最多支持输入50个汉字长度" maxlength="50" datatype="/^[\s\S]{1,50}$/" placeholder="请输入商品名称" number="50"  nullmsg="请输入材质" errormsg="最多支持输入50个汉字长度" autocomplete="off" >
            </div>
            <span class="Validform_checktip"></span>
        </div>-->
        <!--<div class="detail-content">
            <label class="form-label f-l pt-5">限制类型：</label>
            <div style="float: left;position: relative;top:5px;left:10px">
                    <span>
                        <input type="radio" name="radio1" style="margin-right: 5px" value="0" checked>非限制类型
                    </span>
                <span style="margin-left: 15px;margin-right: 15px">
                        <input type="radio" name="radio1" style="margin-right: 5px" value="1">危化品
                    </span>
                <span>
                        <input type="radio" name="radio1" style="margin-right: 5px" value="2">管制刀具
                    </span>
            </div>
        </div>-->
        <div style="margin-left: 10px">
            <div class="mt-15 mb-30 imgTable clearfix">
                <div style="display: inline-block"><i style="color: red;margin-right: 5px;margin-left: 26px">*</i>图片：</div>
                <ul class="upload-img-lists" style="display: inline-block">

                </ul>
                <div style="display: inline-block">
                    <img  class="f-l ml-10" style="width: 50px;height: 50px;" id="imgOperate" src="../../../img/tianjia.png">
                    <input id="imgs" type="file" accept=".jpg,.jpeg,.png"  style="display: none">
                </div>
            </div>
            <div class="mt-15 pb-30 imgTable clearfix">
                <div style="display: inline-block;margin-right:5px">商品资质PDF：</div>
                <!-- <div style="display: inline-block">
                    <img  class="f-l ml-10"  id="qualification-img" src="../../../img/Pdf.png" style="margin-right: 10px;display: none" >
                    <div style="width: 200px">
                        <a href="" id="downLoadQualification" style="display: none">点击下载附件查看</a>
                        <div id="cancelFile" style="cursor: pointer;margin-top: 12px; color: #1476e5;display: none">删除</div>
                    </div>
                    <img  class="f-l ml-10" style="width: 50px;height: 50px;" id="pdfOperate" src="../../../img/tianjia.png">
                    <input id="filePdf" type="file" accept=".pdf"  style="display: none">
                </div> -->

                <!--改造-->
                <div id="qualification_list">
                    
                    <img  class="f-l ml-10" style="width: 50px;height: 50px;" id="pdfOperate" src="../../../img/tianjia.png">
                    <input id="filePdf" type="file" accept=".pdf"  style="display: none">
                </div>
                
                <!--改造-->
            </div>
        </div>
        <div class="detail-content pb-20">
            <input type="text" id="areaInfo" style="display: none">
            <label class="form-label f-l pt-5"><i style="color: red;margin-right: 5px">*</i>销售区域：</label>
            <ul style="overflow: hidden" class="pt-5 saleAreaLists"></ul>
            <div class="ml-60 setArea" style="color: #0a60d6;cursor: pointer">区域设置</div>
        </div>
    </div>
    <!--模块三 新增商品-->
    <div class="section1" id="addtable" style="display: none">
        <div class="title">规格信息</div>
        <table class="table table-border table-bg table-hover table-sort mt-10">
            <thead>
            <tr class="text-l">
                <th><i style="color: red;margin-right: 5px">*</i>规格</th>
                <th>颜色</th>
                <th><i style="color: red;margin-right: 5px">*</i>售价</th>
                <th><i style="color: red;margin-right: 5px">*</i>计量单位</th>
                <th><i style="color: red;margin-right: 5px">*</i>预计出货日</th>
                <th><i style="color: red;margin-right: 5px">*</i>最小起订量</th>
                <th><i style="color: red;margin-right: 5px;">*</i>最长边</th>
                <th><i style="color: red;margin-right: 5px;">*</i>体积</th>
                <th><i style="color: red;margin-right: 5px">*</i>重量</th>
            </tr>
            </thead>
            <tbody id="tableData">
            <tr class="add_tr" style="height: 60px">
                <td class="col-9-1 text-l">
                    <div class="formControls col-sm-8" style="width: 75%">
                        <input type="text" class="input-text radius specifications"
                                datatype="/^[\s\S]{1,127}$/"
                               placeholder="请输入规格"
                               number="127"
                               maxlength="127"
                               nullmsg="请输入规格"
                               errormsg="请输入规格" autocomplete="off">
                    </div>
                    <span class="Validform_checktip"></span>
                </td>
                <td class="col-9-1 text-l">
                    <div class="formControls col-sm-8" style="width: 75%">
                        <input type="text" class="input-text radius color" placeholder="请输入颜色" >
                    </div>
                </td>
                <td class="col-9-1 text-l">
                    <label class="form-label f-l">¥</label>
                    <div class="formControls col-sm-8" style="width: 75%">
                        <input type="text"  class="input-text radius channelPrice"
                               nullmsg="请输入售价"
                               errormsg="请输入售价"
                               autocomplete="off"
                               datatype="*"
                               placeholder="请输入售价"
                               onkeyup="!/^(\d+\.?)?\d{0,2}$/.test(this.value)?(this.value=this.value.substring(0, this.value.length-1)): ''"/>
                    </div>
                    <span class="Validform_checktip"></span>
                </td>
                <td class="col-9-1 unit_id text-l" style="position:relative;" >
                    <div class="col-sm-8" style="width: 75%">
                        <input type="text"  class="input-text radius unitId"
                               nullmsg="请输入计量单位"
                               errormsg="请输入计量单位"
                               placeholder="请输入计量单位"
                               datatype="*"
                               autocomplete="off"
                        >
                    </div>
                    <span class="Validform_checktip"></span>
                    <ul class="search-unit addSearchUnit">
                    </ul>
                </td>
                <td class="col-9-1 text-l">
                    <div class="formControls col-sm-8" style="width: 75%">
                        <input type="text"  class="input-text radius deliveryDay"
                               nullmsg="请输入预计出货日"
                               errormsg="请输入预计出货日"
                               autocomplete="off"
                               datatype="*"
                               placeholder="请输入预计出货日"
                               maxlength="5"
                               number="5"
                               onkeyup="value=value.replace(/[^\d]/g, '').replace(/^0{1,}/g,'')"
                        >
                        <span style="position: absolute;top: 4px;margin-left: 6px;">天</span>
                    </div>
                    <span class="Validform_checktip"></span>
                </td>
                <td class="col-9-1 text-l">
                    <div class="formControls col-sm-8"  style="width: 75%">
                        <input type="text" class="input-text radius miniNum"
                               nullmsg="请输入最小起订量"
                               errormsg="请输入最小起订量"
                               autocomplete="off"
                               datatype="*"
                               placeholder="请输入最小起订量"
                               maxlength="5"
                               number="5"
                               onkeyup="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
                        >
                    </div>
                    <span class="Validform_checktip"></span>
                </td>
                <td class="col-9-1 text-l">
                    <div class="formControls col-sm-8" style="width: 75%">
                        <input
                                type="text" class="input-text radius maxLong"
                                onkeyup="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
                                placeholder="请输入最长边"
                                nullmsg="请输入最长边"
                                errormsg="小数点后最多输入6位有效数字"
                                number="10"
                                maxlength="10"
                                datatype="/^[0-9]+(.[0-9]{1,6})?$/"
                        >
                        <span style="position: absolute;top: 4px;margin-left: 6px;width: 19px;display: inline-block" >cm</span>
                    </div>
                    <span class="Validform_checktip"></span>
                </td>
                <td class="col-9-1 text-l">
                    <div class="formControls col-sm-8"  style="width: 75%">
                        <input
                                type="text" class="input-text radius volume"
                                placeholder="请输入体积"
                                nullmsg="请输入体积"
                                errormsg="小数点后最多输入6位有效数字"
                                autocomplete="off"
                                number="10"
                                datatype="/^[0-9]+(.[0-9]{1,6})?$/"
                                onkeyup="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
                                maxlength="10"
                        >
                        <span style="position: absolute;top: 4px;margin-left: 6px;width: 18px;display: inline-block">m³</span>
                    </div>
                    <span class="Validform_checktip"></span>
                </td>
                <td class="col-9-1 text-l">
                    <div class="formControls col-sm-8"  style="width: 75%">
                        <input type="text" class="input-text radius weight"
                               nullmsg="请输入重量"
                               errormsg="小数点后最多输入6位有效数字"
                               autocomplete="off"
                               datatype="/^[0-9]+(.[0-9]{1,6})?$/"
                               placeholder="请输入重量"
                               maxlength="10"
                               number="10"
                               onkeyup="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
                        >
                        <span style="position: absolute;top: 4px;margin-left: 6px;width: 15px;display: inline-block">kg</span>
                    </div>
                    <span class="Validform_checktip"></span>
                </td>
            </tr>
            </tbody>
        </table>
        <div style="color:#4a90e2;font-size: 16px;cursor: pointer;padding-left: 15px;width: 100px" > <span id="addSpecification">新增规格</span></div>
    </div>
    <!-- 模块三 商品修改-->
    <div class="section1" id="modifytable" style="display: none">
        <div class="title">规格信息</div>
        <table class="table table-border table-bg table-hover table-sort mt-10">
            <thead>
            <tr class="text-l">
                <th style="width: 170px">商品编码</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px;">*</i>规格</th>
                <th style="width: 160px">颜色</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px;">*</i>售价</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px;">*</i>计量单位</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px;">*</i>预计出货日</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px;">*</i>最小起订量</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px;">*</i>最长边</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px;">*</i>体积</th>
                <th style="width: 160px"><i style="color: red;margin-right: 5px">*</i>重量</th>
            </tr>
            </thead>
            <tbody id="modifyTableData"></tbody>
        </table>
        <div style="color:#4a90e2;font-size: 16px;cursor: pointer;padding-left: 15px;width: 100px" id="modifySpecification">新增规格</div>
    </div>
    <!-- 模块四-->
    <div class="section1">
        <div class="title"><i style="color: red;margin-right: 5px">*</i>详细介绍</div>
        <div class="pd-20">
            <script id="editor" type="text/plain" style="width: 100%; height: 500px"></script></div>
        <input id="forJsFileBtn" type="file" accept=".jpg,.jpeg,.png" onchange="uploadPicture(event)" style="display: none"/>
    </div>
    <div class="button">
        <button type="submit" class="buttonLeft-name">提交</button>
    </div>
</form>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script>
<!--/_footer 作为公共模版分离出去-->
<!--时间脚本-->
<script type="text/javascript" src="../../../lib/jedate-6.5.0/dist/jedate.min.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../lib/pagination/jquery.pagination.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../ht-js/frame/doT.min.js?rev=@@hash"></script>
<!--富文本编辑器-->
<script type="text/javascript" charset="utf-8" src="../../../lib/ueditor/1.4.3/ueditor.config.js?rev=@@hash"></script>
<script type="text/javascript" charset="utf-8" src="../../../lib/ueditor/1.4.3/ueditor.all.min.js?rev=@@hash"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../../../lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js?rev=@@hash"></script>

<script src="../../../lib/select2-4.0.3/dist/js/select2.full.min.js"></script>
<script>
    $(document).ready(function () {
            $('#serviceProvider').select2({});  //id为status的控件就被美化了
        });

    var skuFormData = new FormData();
    //var integralSkuCode = sessionStorage.getItem("integralSkuCode");
    var spuImgCount = 0;
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor',{
        toolbars: [
            [
                'source', //源代码
                'anchor', //锚点
                'undo', //撤销
                'redo', //重做
                'bold', //加粗
                'indent', //首行缩进
                // 'snapscreen', //截图
                'italic', //斜体
                'underline', //下划线
                'strikethrough', //删除线
                'subscript', //下标
                'fontborder', //字符边框
                'superscript', //上标
                'formatmatch', //格式刷

                'blockquote', //引用
                'pasteplain', //纯文本粘贴模式
                'selectall', //全选
                'print', //打印
                'preview', //预览
                'horizontal', //分隔线
                'removeformat', //清除格式
                'time', //时间
                'date', //日期
                'unlink', //取消链接
                'insertrow', //前插入行
                'insertcol', //前插入列
                'mergeright', //右合并单元格
                'mergedown', //下合并单元格
                'deleterow', //删除行
                'deletecol', //删除列
                'splittorows', //拆分成行
                'splittocols', //拆分成列
                'splittocells', //完全拆分单元格
                'deletecaption', //删除表格标题
                'inserttitle', //插入标题
                'mergecells', //合并多个单元格
                'deletetable', //删除表格
                'cleardoc', //清空文档
                'insertparagraphbeforetable', //”表格前插入行”
                'insertcode', //代码语言
                'fontfamily', //字体
                'fontsize', //字号
                'paragraph', //段落格式
                /*'simpleupload', //单图上传
                'insertimage', //多图上传*/
                'edittable', //表格属性
                'edittd', //单元格属性
                'link', //超链接
                'emotion', //表情
                'spechars', //特殊字符
                'searchreplace', //查询替换
                'map', //Baidu地图
                'gmap', //Google地图
                'insertvideo', //视频
                'help', //帮助
                'justifyleft', //居左对齐
                'justifyright', //居右对齐
                'justifycenter', //居中对齐
                'justifyjustify', //两端对齐
                'forecolor', //字体颜色
                'backcolor', //背景色
                'insertorderedlist', //有序列表
                'insertunorderedlist', //无序列表
                'fullscreen', //全屏
                'directionalityltr', //从左向右输入
                'directionalityrtl', //从右向左输入
                'rowspacingtop', //段前距
                'rowspacingbottom', //段后距
                'pagebreak', //分页
                'insertframe', //插入Iframe
                'imagenone', //默认
                'imageleft', //左浮动
                'imageright', //右浮动
                // 'attachment', //附件
                'imagecenter', //居中
                'wordimage', //图片转存
                'lineheight', //行间距
                'edittip ', //编辑提示
                'customstyle', //自定义标题
                'autotypeset', //自动排版
                'webapp', //百度应用
                'touppercase', //字母大写
                'tolowercase', //字母小写
                'background', //背景
                'template', //模板
                'scrawl', //涂鸦
                'music', //音乐
                'inserttable', //插入表格
                'drafts', // 从草稿箱加载
                // 'charts', // 图表
            ]
        ]
    });
    UE.registerUI('dialog',function(editor,uiName){
            var btn = new UE.ui.Button({
                name:'上传图片',
                title:'上传图片',
                //需要添加的额外样式，指定icon图标，这里默认使用一个重复的icon
                cssRules :'background-position: -726px -77px;',
                onclick:function () {
                    var forJsFileBtn = $("#forJsFileBtn") ;
                    if (forJsFileBtn){
                        forJsFileBtn.click() ;
                    }
                }
            });

            return btn;
        }
        /*index 指定添加到工具栏上的那个位置，默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的，默认是页面上所有的编辑器都会添加这个按钮*/);
    function uploadPicture(e,val) {
        for (var i = 0; i < e.target.files.length; i++) {
            var file = e.target.files.item(i);
            if (!(/^image\/.*$/i.test(file.type))) {
                $.Huimodalalert("请选择图片类型", 2000);
                continue; //不是图片 就跳出这一次循环
            }
            //实例化FileReader API
            var freader = new FileReader();
            freader.readAsDataURL(file);
            freader.onload = function (e) {
                var formData = new FormData();
                formData.set('file', $("#forJsFileBtn")[0].files[0]);
                uploadDetailPicInfo(formData)
            }
        }
    }
    function uploadDetailPicInfo(formData){
        $.ajax({
            url: root.serviceProviderManagement.uploadForIE8,
            cache: false,  //禁用缓存
            type: "POST",
            // 告诉jQuery不要去处理发送的数据
            processData: false,
            // 告诉jQuery不要去设置Content-Type请求头
            contentType: false,
            data: formData,
            success: function (data) {
                var result = JSON.parse(data);
                var fullPath = result[0].fullPath;
                var value = "<img src='" + fullPath + "'>";
                if(value){
                    UE.getEditor('editor').execCommand('insertHtml', value)
                }
            },
        })
    }

</script>
<!--页面js-->
<script src="../../../ht-js/serviceProvider/customerProperProduct/customerUpdate.js"></script>
</body>
</html>